function changeFace(){
    var reader = new FileReader();//定义文件读取流对象
    reader.readAsDataURL($("fileTxt").files[0]);
    reader.onload = function (ev) {
        $("faceImg").src = ev.target.result;
    }
}
async function add(){
    var formObj=new FormData;
    formObj.append("uploadImg",$("fileTxt").files[0]);

    let config = {
        headers: {'Content-Type': 'multipart/form-data' }
    }
    var uploadFileName;
    await axios.post("/upload",formObj,config).then(resp=>{
        uploadFileName=resp.data;
    })

    axios.get("/user/add",{
        params: {
            userName:$("userName").value,
            password:$("password").value,
            mail:$("mail").value,
            imgUrl:uploadFileName
        }
    }).then(resp=>{
        var info=resp.data;
        if (info=="ok"){
            location.href="/login.html"
        }else{
            info.forEach(n=>{
                $(n.field+"Span").innerHTML=n.defaultMessage;
            })
        }
    })
}